SwiftUI Cookbook by Giordano Scalzo and 
Edgar Nzokwe

SwiftUI Cookbook by Giordano Scalzo and 
Edgar Nzokwe

Author:Giordano Scalzo and 
Edgar Nzokwe
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2021-11-02T00:00:00+00:00


Finally, apply .matchedGeometryEffect to the Image component on the details page: Image(selectedItem.image)

.resizable()

.aspectRatio(contentMode: .fit)

.matchedGeometryEffect(id: selectedItem.image,

in: animation)

Running the app now, when we select a picture from the list, the image smoothly animates, moving to the top of the screen when the details page is fully visible.

When we close the page, the image flies back to its original position in the list:

Figure 8.11 – Hero view transition



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.